package com.lhy.common.web.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import java.io.Serializable;

@Getter
@Setter
public class BasePage implements Serializable {

    public static final Integer DEFAULT_PAGE_SIZE = 10;
    public static final Integer DEFAULT_PAGE_NUMBER = 1;

    /**
     * @Fields serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    @Schema(title = "每页长度", required = false)
    @Min(1)
    @Digits(integer = 100, fraction = 0)
    private Integer rows = DEFAULT_PAGE_SIZE;

    @Schema(title = "页码", required = false)
    @Min(1)
    @Digits(integer = 100, fraction = 0)
    private Integer page = DEFAULT_PAGE_NUMBER;


}
